import java.util.Arrays;
import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 25397
 * Date: 2022-04-09
 * Time: 10:11
 */
public class C {
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        int n=scanner.nextInt();
        int[]arr=new int[n];
        int i=0;
        while(scanner.hasNext()){
            arr[i]=scanner.nextInt();
        }
        for(i=0;i< arr.length;i++){
            int d=0;//比他多的
            int s=0;//比他少的
            int[]brr=new int[arr.length];//放比他多的人做的题目
            int k=0;
            for(int j=0;j< arr.length;j++){
                if(arr[j]>arr[i]){
                    d++;
                    brr[k]=arr[j];
                    k++;
                }
                if(arr[j]<arr[i]){
                    s++;
                }
            }
            if(d<=s){
                System.out.print(0+" ");
            }else{
                k=0;
                Arrays.sort(brr);//ps:brr里面不一定能放满，会有0的情况
                int x=arr[i];//表示还需做多少题
                while(d>s){
                    if(brr[k]!=0){
                        x=brr[k]-x+1;
                        s++;
                    }
                    k++;
                }
                System.out.print(x+" ");
            }
        }
    }
}
